package vip.xiaonuo.modular.xyserver.api;


import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import vip.xiaonuo.core.annotion.version.ApiVersionSwagger;
import vip.xiaonuo.modular.xyserver.entity.XyServer;
import vip.xiaonuo.modular.xyserver.service.XyServerService;
import vip.xiaonuo.sys.core.msg.Result;

import static vip.xiaonuo.sys.core.msg.ResultUtils.success;

@RestController
@Api(tags = "平台相关apis")
@ApiVersionSwagger
@RequestMapping("/server")
public class ApiServerController {

    @Autowired
    private XyServerService xyServerService;


    @GetMapping("/findByType/{id}")
    @ApiOperation(value = "根据类型查询不同服务信息",notes = "1=联系客服,2=用户协议")
    public Result<XyServer> findByType(@PathVariable String id){
        return success(xyServerService.getById(id));
    }

}
